#!/usr/bin/python
#-*-coding:utf-8-*-

import json
import os

class JsonWriterPipeline(object):

    def __init__(self,):
        store_uri = os.path.join(os.path.abspath(os.path.dirname(__file__)),'media/book_covor_image')
        self.file = open('items.jl', 'wb')

    def process_item(self, item, spider):
        line = json.dumps(dict(item)) + "\n"
        line = item['title'] + "-------"
        self.file.write(line)
        return item
    